#include"Tcpserver.hh"

TcpServer::TcpServer(const string &ip,int port)
    :_acceptor(ip.c_str(),port)
     ,_pool(_acceptor)
{
}
TcpServer::~TcpServer()
{}
    void TcpServer::start()
{
    _acceptor.ready();
    _pool.loop();
}
    void TcpServer::stop()
{
    _pool.unloop();
}
    void TcpServer::setallcallback(func_call && close,
                        func_call&& conn,
                        func_call&& msg)
{
    _pool.SetCloseCallback(std::move(close));
    _pool.SetNewconnCallback(std::move(conn));
    _pool.SetNewMsgCallback(std::move(msg));
}
